package com.killer.goods.feign;


import com.killer.common.entity.PageResult;
import com.killer.common.entity.Result;
import com.killer.goods.entity.Sku;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 标准产品单位表 前端控制器
 * </p>
 *
 * @author killer
 * @since 2021-08-29
 */
@FeignClient("shop-goods-service")
@RequestMapping("/sku")
public interface SkuClient {

    @PostMapping("/add")
    public Result add(@RequestBody Sku t);

    @PostMapping("/update")
    public Result update(@RequestBody Sku t);

    @PostMapping("/delete")
    public Result delete(@RequestParam Long id);

    @GetMapping("/findById")
    public Result<Sku> findById(@RequestParam Long id);

    @GetMapping("/search")
    public Result<List<Sku>> search(@RequestParam Map<String, Object> searchMap);

    @GetMapping("/findPage/{pageNum}/{pageSize}")
    public Result<PageResult<Sku>> findPage(@RequestParam Map<String, Object> searchMap,
                                            @PathVariable("pageNum")Integer pageNum,
                                            @PathVariable("pageSize")Integer pageSize);

    @GetMapping("/count")
    public Result<Integer> countByCondition(@RequestParam Map<String, Object> searchMap);

}
